<template>
  <div>我是{{ pageName }}</div>
  <el-input v-model="text"></el-input>
</template>
<script setup>
import { onMounted, watch, ref } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const pageName = ref('')
const text = ref('')

watch(
  () => route.query,
  (val) => {
    pageName.value = route.query.name
  }
)

onMounted(() => {
  pageName.value = route.query.name
})
</script>